<div class="container-nm">
    <ul class="nav nav-pills nav-fill mb-3" id="myTab" role="tablist">
        <li class="nav-item" role="presentation">
            <button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home-tab-pane" type="button" role="tab" aria-controls="home-tab-pane" aria-selected="true">百度指数</button>
        </li>
        <li class="nav-item" role="presentation">
            <button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile-tab-pane" type="button" role="tab" aria-controls="profile-tab-pane" aria-selected="false">新浪指数</button>
        </li>
        <li class="nav-item" role="presentation">
            <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact-tab-pane" type="button" role="tab" aria-controls="contact-tab-pane" aria-selected="false">抖音指数</button>
        </li>
        <li class="nav-item" role="presentation">
            <button class="nav-link" id="disabled-tab" data-bs-toggle="tab" data-bs-target="#disabled-tab-pane" type="button" role="tab" aria-controls="disabled-tab-pane" aria-selected="false">知乎指数</button>
        </li>
    </ul>
    <div class="tab-content" id="myTabContent">
        <div class="tab-pane fade show active" id="home-tab-pane" role="tabpanel" aria-labelledby="home-tab" tabindex="0">
            <table class="table table-striped table-hover" id="urlsTable">
                <thead class="thead-dark">
                <tr>
                    <th>ID</th>
                    <th>主题</th>
                    <th>链接</th>
                    <th>创建时间</th>
                    <th>更新时间</th>
                    <th>类型</th>
                    <th>摘要</th>
                    <th>图片</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <?php
                global $wpdb;

                $results = $wpdb->get_results("SELECT * FROM ningm_news_list where type= 'baidu' order by id");

                if ($results) {
                    foreach ($results as $row) {
                        echo "<tr>";
                        echo "<td>" . $row->id . "</td>";
                        echo "<td>" . $row->title . "</td>";
                        echo "<td><a href='" . $row->url . "' class='text-primary'>跳转访问</a></td>";
                        echo "<td>" . $row->create_time . "</td>";
                        echo "<td>" . $row->update_time . "</td>";
                        echo "<td>" . $row->type . "</td>";
                        echo "<td>" . $row->contant . "</td>";
                        echo "<td><img src='" . $row->img . "' class='img-thumbnail' style='max-width: 100px; max-height: 100px;' alt='新闻照片'></td>";
                        echo "<td><button class='btn btn-sm btn-primary'>编辑</button> <button class='btn btn-sm btn-danger'>删除</button></td>";
                        echo "</tr>";
                    }
                } else {
                    echo "<tr><td colspan='9' class='text-center'>没有符合条件的数据。</td></tr>";
                }
                ?>
                </tbody>
            </table>
        </div>
        <div class="tab-pane fade" id="profile-tab-pane" role="tabpanel" aria-labelledby="profile-tab" tabindex="0">
            <table class="table table-striped table-hover" id="urlsTable">
                <thead class="thead-dark">
                <tr>
                    <th>ID</th>
                    <th>主题</th>
                    <th>链接</th>
                    <th>创建时间</th>
                    <th>更新时间</th>
                    <th>类型</th>
                    <th>摘要</th>
                    <th>图片</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <?php
                global $wpdb;

                $results = $wpdb->get_results("SELECT * FROM ningm_news_list where type= '新浪' order by id");

                if ($results) {
                    foreach ($results as $row) {
                        echo "<tr>";
                        echo "<td>" . $row->id . "</td>";
                        echo "<td>" . $row->title . "</td>";
                        echo "<td><a href='" . $row->url . "' class='text-primary'>跳转访问</a></td>";
                        echo "<td>" . $row->create_time . "</td>";
                        echo "<td>" . $row->update_time . "</td>";
                        echo "<td>" . $row->type . "</td>";
                        echo "<td>" . $row->contant . "</td>";
                        echo "<td><img src='" . $row->img . "' class='img-thumbnail' style='max-width: 100px; max-height: 100px;' alt='新闻照片'></td>";
                        echo "<td><button class='btn btn-sm btn-primary'>编辑</button> <button class='btn btn-sm btn-danger'>删除</button></td>";
                        echo "</tr>";
                    }
                } else {
                    echo "<tr><td colspan='9' class='text-center'>没有符合条件的数据。</td></tr>";
                }
                ?>
                </tbody>
            </table>
        </div>
        <div class="tab-pane fade" id="contact-tab-pane" role="tabpanel" aria-labelledby="contact-tab" tabindex="0">
            <table class="table table-striped table-hover" id="urlsTable">
                <thead class="thead-dark">
                <tr>
                    <th>ID</th>
                    <th>主题</th>
                    <th>链接</th>
                    <th>创建时间</th>
                    <th>更新时间</th>
                    <th>类型</th>
                    <th>摘要</th>
                    <th>图片</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <?php
                global $wpdb;

                $results = $wpdb->get_results("SELECT * FROM ningm_news_list where type= 'douyin' order by id");

                if ($results) {
                    foreach ($results as $row) {
                        echo "<tr>";
                        echo "<td>" . $row->id . "</td>";
                        echo "<td>" . $row->title . "</td>";
                        echo "<td><a href='" . $row->url . "' class='text-primary'>跳转访问</a></td>";
                        echo "<td>" . $row->create_time . "</td>";
                        echo "<td>" . $row->update_time . "</td>";
                        echo "<td>" . $row->type . "</td>";
                        echo "<td>" . $row->contant . "</td>";
                        echo "<td><img src='" . $row->img . "' class='img-thumbnail' style='max-width: 100px; max-height: 100px;' alt='新闻照片'></td>";
                        echo "<td><button class='btn btn-sm btn-primary'>编辑</button> <button class='btn btn-sm btn-danger'>删除</button></td>";
                        echo "</tr>";
                    }
                } else {
                    echo "<tr><td colspan='9' class='text-center'>没有符合条件的数据。</td></tr>";
                }
                ?>
                </tbody>
            </table>
        </div>
        <div class="tab-pane fade" id="disabled-tab-pane" role="tabpanel" aria-labelledby="disabled-tab" tabindex="0">
            <table class="table table-striped table-hover" id="urlsTable">
                <thead class="thead-dark">
                <tr>
                    <th>ID</th>
                    <th>主题</th>
                    <th>链接</th>
                    <th>创建时间</th>
                    <th>更新时间</th>
                    <th>类型</th>
                    <th>摘要</th>
                    <th>图片</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <?php
                global $wpdb;

                $results = $wpdb->get_results("SELECT * FROM ningm_news_list where type= '知乎' order by id");

                if ($results) {
                    foreach ($results as $row) {
                        echo "<tr>";
                        echo "<td>" . $row->id . "</td>";
                        echo "<td>" . $row->title . "</td>";
                        echo "<td><a href='" . $row->url . "' class='text-primary'>跳转访问</a></td>";
                        echo "<td>" . $row->create_time . "</td>";
                        echo "<td>" . $row->update_time . "</td>";
                        echo "<td>" . $row->type . "</td>";
                        echo "<td>" . $row->contant . "</td>";
                        echo "<td><img src='" . $row->img . "' class='img-thumbnail' style='max-width: 100px; max-height: 100px;' alt='新闻照片'></td>";
                        echo "<td><button class='btn btn-sm btn-primary'>编辑</button> <button class='btn btn-sm btn-danger'>删除</button></td>";
                        echo "</tr>";
                    }
                } else {
                    echo "<tr><td colspan='9' class='text-center'>没有符合条件的数据。</td></tr>";
                }
                ?>
                </tbody>
            </table>
        </div>
    </div>
</div>
